package ae.pcfc.etks.online.common.domain;


import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * ProcStepActions entity. @author Mohtisham.Salahria
 */
@Entity
@Table(name = "T_ETKS_PROC_STEP_ACTIONS", schema = "ETKS_ONLINE_DBA")
@SequenceGenerator(name = "SQ_ETKS_PROC_STP_ACT", sequenceName = "SQ_ETKS_PROC_STP_ACT", initialValue = 1, allocationSize = 1)
public class ProcStepActions implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private Long actionId;
	private AppMetaData AppMetaData;
	private ProcessStep ProcessStep;
	private String actionDesc;
	private Date actionDate;
	private String actionUser;
	private Date date1;

	public ProcStepActions() {
	}

	public ProcStepActions(Long actionId,
			ProcessStep ProcessStep, String actionDesc) {
		this.actionId = actionId;
		this.ProcessStep = ProcessStep;
		this.actionDesc = actionDesc;
	}

	public ProcStepActions(Long actionId,
			AppMetaData AppMetaData,
			ProcessStep ProcessStep, String actionDesc,
			Date actionDate, String actionUser, Date date1) {
		this.actionId = actionId;
		this.AppMetaData = AppMetaData;
		this.ProcessStep = ProcessStep;
		this.actionDesc = actionDesc;
		this.actionDate = actionDate;
		this.actionUser = actionUser;
		this.date1 = date1;
	}

	@Id
	@GeneratedValue( strategy = GenerationType.SEQUENCE, generator="SQ_ETKS_PROC_STP_ACT")
	@Column(name = "ACTION_ID", unique = true, nullable = false, length = 10)
	public Long getActionId() {
		return this.actionId;
	}

	public void setActionId(Long actionId) {
		this.actionId = actionId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "APPLICATION_ID")
	public AppMetaData getAppMetaData() {
		return this.AppMetaData;
	}

	public void setAppMetaData(AppMetaData AppMetaData) {
		this.AppMetaData = AppMetaData;
	}
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumns({
			@JoinColumn(name = "PROCESS_STEP_CODE", referencedColumnName = "PROCESS_STEP_CODE", nullable = false),
			@JoinColumn(name = "PROCESS_CODE", referencedColumnName = "PROCESS_CODE", nullable = false) })
	public ProcessStep getProcessStep() {
		return this.ProcessStep;
	}
	public void setProcessStep(ProcessStep ProcessStep) {
		this.ProcessStep = ProcessStep;
	}

	@Column(name = "ACTION_DESC", nullable = false, length = 10)
	public String getActionDesc() {
		return this.actionDesc;
	}

	public void setActionDesc(String actionDesc) {
		this.actionDesc = actionDesc;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "ACTION_DATE", length = 7)
	public Date getActionDate() {
		return this.actionDate;
	}

	public void setActionDate(Date actionDate) {
		this.actionDate = actionDate;
	}

	@Column(name = "ACTION_USER", length = 50)
	public String getActionUser() {
		return this.actionUser;
	}

	public void setActionUser(String actionUser) {
		this.actionUser = actionUser;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "DATE1", length = 7)
	public Date getDate1() {
		return this.date1;
	}

	public void setDate1(Date date1) {
		this.date1 = date1;
	}

}
